<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function fn(a,b,c,...rest){
            console.log(1)
            console.log(2)
            console.log(3)
            console.log(rest)
        }
        fn(1,2,3,4,5,6,this,true)

        // let arr =[1,2,3,4,5,6,9,8,7]
        // let arr =new Set (["张三","李四",2,4,7,4])
        let arr = new Map(
            [
                ["name","玩偶"],
                ["age","18"]
            ]
        )
        console.log(arr)
        console.log(...arr)

        // let a = [123];
        // let b = [456];
        let a = [1,2,3];
        let b = [4,5,6];

        // let a1 = a.concat(b);
        let a1 = [...a,...b]

        console.log(a) 
        console.log(b) 
        console.log(a1) 

        // a是不是数组
        console.log(a instanceof Array) 

        let set = new Set([2,4,9,0,6,4,2,1,8,1])
        console.log(set)
          // 是不是数组
          console.log(set instanceof Array)
        // 转数组
        // let set1 = Array.from(set)
        let set1 =[...set]

        // set1是不是数组
        console.log(set1 instanceof Array)

        let b1 = [4,5,6,"小红",["小米手机","华为"]];
        console.log(b1[4][0])
        let b2 = [...b1];
        console.log(b2)

        b1[4][0]="苹果"
        b1[0]="小米"

        console.log(b1)
        console.log(b2)


        let obj ={
            name :"小红",
            aihao:["男","吃东西"]    

        }

        let obj1 = {...obj}

        obj[1]="小兰";//添加一个小兰
        obj.name="江户川柯南";
        obj.aihao[0]="小兰是空手道高手"

        // obj[2][0]="工藤新一"
        


        console.log(obj)
        console.log(obj1)




        




    </script>
</body>
</html>